--DELETE FROM cat_job_category_mapping
--select * from cat_job_category_mapping
INSERT INTO cat_job_category_mapping
SELECT
newid() AS [Id],case len(convert(varchar(10),id))
    when 5 then '00000000-0000-0000-0000-0000000' + convert(varchar(10),id) 
    when 6 then '00000000-0000-0000-0000-000000' + convert(varchar(10),id) end AS [JobId],JobClass AS [Category]FROM srv_lnk.nchr2008.dbo.Companyjob
where id in(select right(id,6) from cat_job) 
